package com.fourforfo.fourmall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.fourforfo.common.to.mq.SeckillOrderTO;
import com.fourforfo.common.utils.PageUtils;
import com.fourforfo.fourmall.order.constant.OrderStatusEnum;
import com.fourforfo.fourmall.order.entity.OrderEntity;
import com.fourforfo.fourmall.order.vo.OrderConfirmVO;
import com.fourforfo.fourmall.order.vo.OrderSubmitResponseVO;
import com.fourforfo.fourmall.order.vo.OrderSubmitVO;
import com.fourforfo.fourmall.order.vo.alipay.PayAsyncVO;
import com.fourforfo.fourmall.order.vo.alipay.PayVO;
import com.xxl.sso.core.user.XxlSsoUser;

import java.util.Map;

/**
 * 订单
 *
 * @author fourforfo
 * @email fourforfo@gmail.com
 * @date 2022-06-16 12:36:49
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 获取订单确认页面所需的各种信息
     * @return
     */
    OrderConfirmVO confirmOrder(XxlSsoUser xxlSsoUser);

    /**
     * 创建订单
     * @param submitVO
     * @param xxlUser
     * @return
     */
    OrderSubmitResponseVO submitOrder(OrderSubmitVO submitVO, XxlSsoUser xxlUser);

    /**
     * 关闭订单方法
     * @param orderEntity
     */
    void closeOrder(OrderEntity orderEntity);

    /**
     * 获取支付返回结果
     * @param orderSn
     * @return
     */
    PayVO getOrderPay(String orderSn);

    /**
     * 查询当前用户的订单以及订单详情数据
     * @param params
     * @param userid
     * @return
     */
    PageUtils listWithItem(Map<String, Object> params, String userid);

    /**
     * 处理支付宝异步通知
     * @param payAsyncVO
     * @return
     */
    String handlePayResult(PayAsyncVO payAsyncVO);

    /**
     * 创建秒杀订单
     * @param seckillOrderTO
     */
    Boolean createSeckillOrder(SeckillOrderTO seckillOrderTO);
}

